package unit5.collection;




import unit3.lianxi.CollegeStudent;

import java.util.ArrayList;
import java.util.Collection;

public class TestCollection {
    public static void main(String[] args) {
        //定义2个大学生
        CollegeStudent c1=new CollegeStudent(1111,"陈君祥","软件");
        CollegeStudent c2=new CollegeStudent(2222,"小明","电商");
        //定义一个集合
        Collection col= new ArrayList();
        col.add(c1);
        col.add(c2);
        System.out.println("集合大小是："+col.size());
        col.remove(c1);
        System.out.println("集合大小是："+col.size());
        System.out.println("删除c1以后，集合里就没有c1了。"+col.contains(c2));
 //       col.trimToSize();
    }
}
